<?php

class Profile_Form_EditGroup extends Zend_Form
{
	public function init()
	{
		parent::init();

        // Set the method for the display form to POST
		$this
			->setAction('')
			->setMethod('post')
		;

		$stripSlashesFilter = new Euso_Filter_StripSlashes();

		$elem = new Zend_Form_Element_Text('profile_tagline');
		$elem
			->setLabel('Tagline:')
			->addFilter($stripSlashesFilter)
			->addFilter('StringTrim')
			->setAttrib('size', 36)
			->addValidator('StringLength', false, array(0,500))
			->setAttrib('maxLength', 500)
		;
		$this->addElement($elem);

		$elem = new Zend_Form_Element_TextArea('profile_about');
		$elem
			->setLabel('About:')
			->addFilter($stripSlashesFilter)
			->addFilter('StringTrim')
			->setAttrib('rows', 4)
			->setAttrib('cols', 64)
			->setAttrib('escape', false)
		;
		$this->addElement($elem);

		$elem = new Zend_Form_Element_Text('profile_location');
		$elem
			->setLabel('Location:')
			->addFilter($stripSlashesFilter)
			->addFilter('StringTrim')
			->setAttrib('size', 36)
			->addValidator('StringLength', false, array(0,500))
			->setAttrib('maxLength', 500)
		;
		$this->addElement($elem);

		$elem = new Zend_Form_Element_Text('profile_website');
		$elem
			->setLabel('Website:')
			->addFilter($stripSlashesFilter)
			->addFilter('StringTrim')
			->setAttrib('size', 36)
			->addValidator('StringLength', false, array(0,500))
			->setAttrib('maxLength', 500)
		;
		$this->addElement($elem);

        // Add the submit button
		$submit = new Zend_Form_Element_Submit('submit');
		$submit
			->setLabel('Save')
			->setIgnore(true)
			->setAttrib('class', 'submit')
		;
		$this->addElement($submit);
	}
}
